package com.hp.siminterface.webservice.impl;

import java.util.List;

import com.hp.siminterface.domain.Inventory;
import com.hp.siminterface.persistence.InventoryMapper;
import com.hp.siminterface.webservice.InventoryService;

public class InventoryServiceImpl implements InventoryService {
	private InventoryMapper inventoryMapper;

	@Override
	public Inventory[] getInventory() {
		List<Inventory> inventorys = inventoryMapper.selectInventory();
		Inventory[] inventoryArray = new Inventory[inventorys.size()];
		int i = 0;
		for (Inventory inventory : inventorys) {
			inventoryArray[i] = inventory;
			i++;
		}
		return inventoryArray;
	}

	public void setInventoryMapper(InventoryMapper inventoryMapper) {
		this.inventoryMapper = inventoryMapper;
	}

}
